<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS背景(background)</title>
    <style>
        body {
            /* background-color: blueviolet; */
            /* background-image: url(./img/headImg.jpg); */
            /* background-repeat: no-repeat; */
            /* background-position: center bottom; */
            /* background-size: cover; */
            /* background-size: contain; */
            /* background-attachment: fixed; */
            background: #512fdb url(./img/headImg.jpg) no-repeat fixed right/contain;
        }
        div {
            width: 300px;
            height: 2000px;
            background-color: #141315;
        }
    </style>
</head>
<body>
    <!--  -->
    <div>
        文字
    </div>
</body>
</html>